﻿<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="finance_Discount.aspx.cs"
    Inherits="School.Pages.Accounting.finance_Discount" MasterPageFile="~/MasterALSafa.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:Panel ID="Plsearch" runat="server">
        <table dir="rtl" style="width: 100%; float: right">
            <tr>
                <td style="width: 72px">
                </td>
                <td class="admintitle" align="center">
                    بحث الخصومات
                </td>
            </tr>
            <tr>
                <td style="width: 72px">
                </td>
                <td nowrap="nowrap">
                    <table align="right" dir="rtl" style="width: 100%; float: right; margin-right: 0px;">
                        <tr>
                            <td style="width: 74px">
                                الإسم
                            </td>
                            <td>
                                <asp:TextBox ID="txtnamrSearch" runat="server" Width="150px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 74px">
                                الكود
                            </td>
                            <td>
                                <asp:TextBox ID="txtCode" runat="server" Width="150px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 74px">
                                نوع الإيراد
                            </td>
                            <td>
                                <asp:ListBox ID="LbTypesearch" runat="server" Width="150px" Height="111px" DataTextField="Name"
                                    DataValueField="ID"></asp:ListBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 59px">
                                نوع الخصم
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 59px">
                            </td>
                            <td>
                                <asp:RadioButton ID="rdbfjobSearch" runat="server" GroupName="diS" Text="وظيفة الأب"
                                    Checked="True" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 59px">
                            </td>
                            <td>
                                <asp:RadioButton ID="rdbMjobSearch" runat="server" GroupName="diS" Text="وظيفة الأم" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 59px">
                            </td>
                            <td>
                                <asp:RadioButton ID="rdbfStutSearch" runat="server" GroupName="diS" Text="الحالة الإجتماعية للأب" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 59px">
                            </td>
                            <td>
                                <asp:RadioButton ID="rdbMStutSearch" runat="server" GroupName="diS" Text="الحالة الإجتماعية للأم" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 59px">
                            </td>
                            <td>
                                <asp:RadioButton ID="rdbbrotherSearch" runat="server" GroupName="diS" Text="عدد الأخوة" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 59px">
                            </td>
                            <td>
                                <asp:RadioButton ID="rdbExSearch" runat="server" GroupName="diS" Text="المتفوقين" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 59px">
                            </td>
                            <td>
                                <asp:RadioButton ID="rdbOtherSearch" runat="server" GroupName="diS" Text="أخري" 
                                    AutoPostBack="True" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td style="width: 72px">
                </td>
                <td>
                    <asp:Button ID="btnSearch" runat="server" Text="بحث" CssClass="graybutton" OnClick="btnSearch_Click" />
                    &nbsp;<asp:Button ID="btnNew" runat="server" CssClass="graybutton" OnClick="btnNew_Click"
                        Text="إضافة" />
                    &nbsp;
                    <asp:Literal ID="lbltstsearch" runat="server" Visible="False"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td align="right">
                    <asp:GridView ID="gvsearch" runat="server" AutoGenerateColumns="False" AlternatingRowStyle-CssClass="GridItemAltername"
                        CssClass="Grid" FooterStyle-CssClass="GridHeaderFooter" HeaderStyle-CssClass="GridHeaderFooter"
                        PagerStyle-CssClass="GridPager" DataKeyNames="Id,Type" OnRowDeleting="gvsearch_RowDeleting"
                        Width="100%">
                        <AlternatingRowStyle CssClass="GridItemAltername" />
                        <Columns>
                            <asp:BoundField DataField="Code" HeaderText="الكود" ReadOnly="True" SortExpression="Code" />
                            <asp:BoundField DataField="Name" HeaderText="اسم الخصم" SortExpression="Name" />
                            <asp:TemplateField HeaderText="نوع الخصم">
                                <ItemTemplate>
                                    <asp:Label ID="lbldisType" runat="server" Text='<%# GetDiscType(Eval("Type")) %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="النوع">
                                <ItemTemplate>
                                    <asp:Label ID="Type" runat="server" Text='<%# GetType(Eval("TypeIn")) %>'></asp:Label>
                                    <asp:Label ID="LblType" runat="server" Text='<%# Eval("TypeIn") %>' Visible="false"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="القيمة">
                                <ItemTemplate>
                                    <asp:Label ID="Value" runat="server" Text='<%# GetValue(Eval("TypeIn"),Eval("TypeIn")) %>'></asp:Label>
                                    <asp:Label ID="LblValue" runat="server" Text='<%# Eval("Value") %>' Visible="false"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField DeleteText="حذف" ShowDeleteButton="True">
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:CommandField>
                        </Columns>
                        <FooterStyle CssClass="GridHeaderFooter" />
                        <HeaderStyle CssClass="GridHeaderFooter" />
                        <PagerStyle CssClass="GridPager" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="Pladd" runat="server" Visible="False">
        <table dir="rtl" style="width: 100%; float: right">
            <tr>
                <td class="admintitle" align="center">
                    الخصومات
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap">
                    <table align="right" dir="rtl" style="width: 100%; float: right">
                        <tr>
                            <td style="width: 74px">
                                الإسم
                            </td>
                            <td>
                                <asp:TextBox ID="txtdisName" runat="server" Width="150px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtdisName"
                                    Display="Dynamic" ErrorMessage="أدخل اسم" ForeColor="Red" ValidationGroup="Dis">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 74px">
                                الكود
                            </td>
                            <td>
                                <asp:TextBox ID="txtdisCode" runat="server" Width="150px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 74px">
                                البيان
                            </td>
                            <td>
                                <asp:TextBox ID="txtdisDetail" runat="server" Height="79px" TextMode="MultiLine"
                                    Width="150px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 74px">
                                نوع الإيراد
                            </td>
                            <td>
                                <asp:ListBox ID="LBdiscType" runat="server" Width="150px" Height="111px" DataTextField="Name"
                                    DataValueField="ID" SelectionMode="Multiple"></asp:ListBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="LBdiscType"
                                    Display="Dynamic" ErrorMessage="اختر ايراد" ForeColor="Red" ValidationGroup="Dis">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <table dir="rtl" style="width: 100%; float: right" class="tableJquery">
                                <tr>
                                    <td style="width: 59px">
                                        نوع الخصم
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 59px">
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="rdbFjob" runat="server" GroupName="di" Text="وظيفة الأب" AutoPostBack="True"
                                            OnCheckedChanged="rdbFjob_CheckedChanged" />
                                        <asp:Panel ID="PlFjob" runat="server" Visible="False">
                                            <asp:GridView ID="gvFJob" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                                                AlternatingRowStyle-CssClass="GridItemAltername" CssClass="Grid" FooterStyle-CssClass="GridHeaderFooter"
                                                HeaderStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager">
                                                <AlternatingRowStyle CssClass="GridItemAltername" />
                                                <Columns>
                                                    <asp:BoundField DataField="Name" HeaderText="الوظيفة" ReadOnly="True" SortExpression="Name" />
                                                    <asp:TemplateField HeaderText="المبلغ">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="txtval" runat="server" Width="150px"></asp:TextBox>
                                                            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtval"
                                                                Display="Dynamic" ErrorMessage="ادخل قيمة" ForeColor="Red" Operator="DataTypeCheck"
                                                                Type="Double"></asp:CompareValidator>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="النسبة">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="txtper" runat="server" Width="150px"></asp:TextBox>%
                                                            <asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="txtper"
                                                                Display="Dynamic" ErrorMessage="أدخل نسبة" ForeColor="Red" Type="Double"></asp:CompareValidator>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <FooterStyle CssClass="GridHeaderFooter" />
                                                <HeaderStyle CssClass="GridHeaderFooter" />
                                                <PagerStyle CssClass="GridPager" />
                                            </asp:GridView>
                                        </asp:Panel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 59px">
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="rdbMjob" runat="server" GroupName="di" Text="وظيفة الأم" AutoPostBack="True"
                                            OnCheckedChanged="rdbMjob_CheckedChanged" />
                                        <asp:Panel ID="PLMjob" runat="server" Visible="False">
                                            <asp:GridView ID="gvMJob" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                                                AlternatingRowStyle-CssClass="GridItemAltername" CssClass="Grid" FooterStyle-CssClass="GridHeaderFooter"
                                                HeaderStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager">
                                                <AlternatingRowStyle CssClass="GridItemAltername" />
                                                <Columns>
                                                    <asp:BoundField DataField="Name" HeaderText="الوظيفة" ReadOnly="True" SortExpression="Name" />
                                                    <asp:TemplateField HeaderText="المبلغ">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="txtval" runat="server" Width="150px"></asp:TextBox>
                                                            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtval"
                                                                Display="Dynamic" ErrorMessage="ادخل قيمة" ForeColor="Red" Operator="DataTypeCheck"
                                                                Type="Double"></asp:CompareValidator>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="النسبة">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="txtper" runat="server" Width="150px"></asp:TextBox>%
                                                            <asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="txtper"
                                                                Display="Dynamic" ErrorMessage="أدخل نسبة" ForeColor="Red" Type="Double"></asp:CompareValidator>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <FooterStyle CssClass="GridHeaderFooter" />
                                                <HeaderStyle CssClass="GridHeaderFooter" />
                                                <PagerStyle CssClass="GridPager" />
                                            </asp:GridView>
                                        </asp:Panel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 59px">
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="rdbFstatus" runat="server" GroupName="di" Text="الحالة الإجتماعية للأب"
                                            AutoPostBack="True" OnCheckedChanged="rdbFstatus_CheckedChanged" />
                                        <asp:Panel ID="PlFstatus" runat="server" Visible="False">
                                            <asp:GridView ID="gvFstatu" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                                                AlternatingRowStyle-CssClass="GridItemAltername" CssClass="Grid" FooterStyle-CssClass="GridHeaderFooter"
                                                HeaderStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager">
                                                <AlternatingRowStyle CssClass="GridItemAltername" />
                                                <Columns>
                                                    <asp:BoundField DataField="Name" HeaderText="الحالة" ReadOnly="True" SortExpression="Name" />
                                                    <asp:TemplateField HeaderText="المبلغ">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="txtval" runat="server" Width="150px"></asp:TextBox>
                                                            <asp:CompareValidator ID="CompareValidator3" runat="server" ControlToValidate="txtval"
                                                                Display="Dynamic" ErrorMessage="ادخل قيمة" ForeColor="Red" Operator="DataTypeCheck"
                                                                Type="Double"></asp:CompareValidator>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="النسبة">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="txtper" runat="server" Width="150px"></asp:TextBox>%
                                                            <asp:CompareValidator ID="CompareValidator4" runat="server" ControlToValidate="txtper"
                                                                Display="Dynamic" ErrorMessage="أدخل نسبة" ForeColor="Red" Type="Double"></asp:CompareValidator>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <FooterStyle CssClass="GridHeaderFooter" />
                                                <HeaderStyle CssClass="GridHeaderFooter" />
                                                <PagerStyle CssClass="GridPager" />
                                            </asp:GridView>
                                        </asp:Panel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 59px">
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="rdbMstatus" runat="server" GroupName="di" Text="الحالة الإجتماعية للأم"
                                            AutoPostBack="True" OnCheckedChanged="rdbMstatus_CheckedChanged" />
                                        <asp:Panel ID="PlMstatus" runat="server" Visible="False">
                                            <asp:GridView ID="gvMStatue" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                                                AlternatingRowStyle-CssClass="GridItemAltername" CssClass="Grid" FooterStyle-CssClass="GridHeaderFooter"
                                                HeaderStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager">
                                                <AlternatingRowStyle CssClass="GridItemAltername" />
                                                <Columns>
                                                    <asp:BoundField DataField="Name" HeaderText="الحالة" ReadOnly="True" SortExpression="Name" />
                                                    <asp:TemplateField HeaderText="المبلغ">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="txtval" runat="server" Width="150px"></asp:TextBox>
                                                            <asp:CompareValidator ID="CompareValidator5" runat="server" ControlToValidate="txtval"
                                                                Display="Dynamic" ErrorMessage="ادخل قيمة" ForeColor="Red" Operator="DataTypeCheck"
                                                                Type="Double"></asp:CompareValidator>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="النسبة">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="txtper" runat="server" Width="150px"></asp:TextBox>%
                                                            <asp:CompareValidator ID="CompareValidator6" runat="server" ControlToValidate="txtper"
                                                                Display="Dynamic" ErrorMessage="أدخل نسبة" ForeColor="Red" Type="Double"></asp:CompareValidator>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <FooterStyle CssClass="GridHeaderFooter" />
                                                <HeaderStyle CssClass="GridHeaderFooter" />
                                                <PagerStyle CssClass="GridPager" />
                                            </asp:GridView>
                                        </asp:Panel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 59px">
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="rdbbrother" runat="server" GroupName="di" Text="عدد الأخوة"
                                            AutoPostBack="True" OnCheckedChanged="rdbbrother_CheckedChanged" />
                                        <asp:Panel ID="Plbrother" runat="server" Visible="False">
                                            <table dir="rtl" style="width: 100%; float: right">
                                                <tr>
                                                    <td align="center" style="width: 94px">
                                                        العدد
                                                    </td>
                                                    <td align="center" style="width: 60px">
                                                        المبلغ
                                                    </td>
                                                    <td align="center" style="width: 174px">
                                                        النسبة
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td nowrap="nowrap" style="width: 94px">
                                                        <asp:TextBox ID="txtbroNumber" runat="server" Width="150px"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtbroNumber"
                                                            Display="Dynamic" ErrorMessage="العدد مطلوب" ForeColor="Red" ValidationGroup="bro">*</asp:RequiredFieldValidator>
                                                    </td>
                                                    <td style="width: 60px">
                                                        <asp:TextBox ID="txtbroval" runat="server" Width="150px"></asp:TextBox>
                                                    </td>
                                                    <td style="width: 174px">
                                                        <asp:TextBox ID="txtbroper" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:Button ID="btnbroadd" runat="server" CssClass="graybutton" OnClick="btnbroadd_Click"
                                                            Text="إضافة" ValidationGroup="bro" />
                                                        <br />
                                                        <asp:Literal ID="lbltest" runat="server" Visible="False"></asp:Literal>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right" colspan="3">
                                                        <asp:GridView ID="gvBrother" runat="server" AutoGenerateColumns="False" DataMember="Id"
                                                            Style="margin-right: 0px" Width="551px" AlternatingRowStyle-CssClass="GridItemAltername"
                                                            CssClass="Grid" FooterStyle-CssClass="GridHeaderFooter" HeaderStyle-CssClass="GridHeaderFooter"
                                                            PagerStyle-CssClass="GridPager" OnRowDeleting="gvBrother_RowDeleting">
                                                            <AlternatingRowStyle CssClass="GridItemAltername" />
                                                            <Columns>
                                                                <asp:TemplateField HeaderText="عدد الأخوه" SortExpression="Number">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="lblnumber" runat="server" Text='<%# Bind("Number") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Number") %>'></asp:TextBox>
                                                                    </EditItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="المبلغ" SortExpression="Val">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="txtval" runat="server" Text='<%# Bind("Val") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Val") %>'></asp:TextBox>
                                                                    </EditItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="النسبة" SortExpression="Per">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="txtper" runat="server" Text='<%# Bind("Per") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Per") %>'></asp:TextBox>
                                                                    </EditItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:CommandField DeleteText="حذف" ShowDeleteButton="True" ShowHeader="True">
                                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                                </asp:CommandField>
                                                            </Columns>
                                                            <FooterStyle CssClass="GridHeaderFooter" />
                                                            <HeaderStyle CssClass="GridHeaderFooter" />
                                                            <PagerStyle CssClass="GridPager" />
                                                        </asp:GridView>
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 59px">
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="rdbExcellent" runat="server" GroupName="di" Text="المتفوقين"
                                            AutoPostBack="True" OnCheckedChanged="rdbExcellent_CheckedChanged" />
                                        <asp:Panel ID="PlExcellent" runat="server" Visible="False">
                                            <table dir="rtl" style="width: 100%; float: right">
                                                <tr>
                                                    <td align="center" style="width: 94px">
                                                        الترتيب
                                                    </td>
                                                    <td align="center" style="width: 60px">
                                                        المبلغ
                                                    </td>
                                                    <td align="center" style="width: 174px">
                                                        النسبة
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td nowrap="nowrap" style="width: 94px">
                                                        <asp:TextBox ID="txtorder" runat="server" Width="150px"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtorder"
                                                            Display="Dynamic" ErrorMessage="العدد مطلوب" ForeColor="Red" ValidationGroup="Ex">*</asp:RequiredFieldValidator>
                                                    </td>
                                                    <td style="width: 60px">
                                                        <asp:TextBox ID="txtvalEx" runat="server" Width="150px"></asp:TextBox>
                                                    </td>
                                                    <td style="width: 174px">
                                                        <asp:TextBox ID="txtperEx" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:Button ID="btnaddEx" runat="server" CssClass="graybutton" OnClick="btnaddEx_Click"
                                                            Text="إضافة" ValidationGroup="Ex" />
                                                        <br />
                                                        <asp:Literal ID="lbltstEx" runat="server" Visible="False"></asp:Literal>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right" colspan="3">
                                                        <asp:GridView ID="gvEx" runat="server" AutoGenerateColumns="False" DataMember="Id"
                                                            Style="margin-right: 0px" Width="551px" AlternatingRowStyle-CssClass="GridItemAltername"
                                                            CssClass="Grid" FooterStyle-CssClass="GridHeaderFooter" HeaderStyle-CssClass="GridHeaderFooter"
                                                            PagerStyle-CssClass="GridPager" OnRowDeleting="gvEx_RowDeleting">
                                                            <AlternatingRowStyle CssClass="GridItemAltername" />
                                                            <Columns>
                                                                <asp:TemplateField HeaderText="الترتيب" SortExpression="Number">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="lblnumber" runat="server" Text='<%# Bind("Number") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Number") %>'></asp:TextBox>
                                                                    </EditItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="المبلغ" SortExpression="Val">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="txtval" runat="server" Text='<%# Bind("Val") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Val") %>'></asp:TextBox>
                                                                    </EditItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="النسبة" SortExpression="Per">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="txtper" runat="server" Text='<%# Bind("Per") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Per") %>'></asp:TextBox>
                                                                    </EditItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:CommandField DeleteText="حذف" ShowDeleteButton="True" ShowHeader="True">
                                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                                </asp:CommandField>
                                                            </Columns>
                                                            <FooterStyle CssClass="GridHeaderFooter" />
                                                            <HeaderStyle CssClass="GridHeaderFooter" />
                                                            <PagerStyle CssClass="GridPager" />
                                                        </asp:GridView>
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 59px">
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="rdbOther" runat="server" GroupName="di" Text="أخري" 
                                            AutoPostBack="True" oncheckedchanged="rdbOther_CheckedChanged" />
                                        <asp:Panel ID="PLOther" runat="server" Visible="False">
                                            <table dir="rtl" style="width: 100%; float: right">
                                                <tr>
                                                    <td align="center" style="width: 60px">
                                                        المبلغ
                                                    </td>
                                                    <td align="center" style="width: 174px">
                                                        النسبة
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td nowrap="nowrap" style="width: 60px">
                                                        <asp:TextBox ID="txtvalother" runat="server" Width="150px"></asp:TextBox>
                                                    </td>
                                                    <td style="width: 174px">
                                                        <asp:TextBox ID="txtPerOther" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:Button ID="Btnaddother" runat="server" CssClass="graybutton" OnClick="Btnaddother_Click"
                                                            Text="إضافة" />
                                                        <br />
                                                        <asp:Literal ID="Literal1" runat="server" Visible="False"></asp:Literal>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right" colspan="3">
                                                        <asp:GridView ID="gvOther" runat="server" AutoGenerateColumns="False" DataMember="Id"
                                                            Style="margin-right: 0px" Width="551px" AlternatingRowStyle-CssClass="GridItemAltername"
                                                            CssClass="Grid" FooterStyle-CssClass="GridHeaderFooter" HeaderStyle-CssClass="GridHeaderFooter"
                                                            PagerStyle-CssClass="GridPager" OnRowDeleting="gvOther_RowDeleting">
                                                            <AlternatingRowStyle CssClass="GridItemAltername" />
                                                            <Columns>
                                                                <asp:TemplateField HeaderText="المبلغ" SortExpression="Val">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="txtval" runat="server" Text='<%# Bind("Val") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Val") %>'></asp:TextBox>
                                                                    </EditItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="النسبة" SortExpression="Per">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="txtper" runat="server" Text='<%# Bind("Per") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Per") %>'></asp:TextBox>
                                                                    </EditItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:CommandField DeleteText="حذف" ShowDeleteButton="True" ShowHeader="True">
                                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                                </asp:CommandField>
                                                            </Columns>
                                                            <FooterStyle CssClass="GridHeaderFooter" />
                                                            <HeaderStyle CssClass="GridHeaderFooter" />
                                                            <PagerStyle CssClass="GridPager" />
                                                        </asp:GridView>
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap">
                    <table dir="rtl" style="width: 100%; float: right">
                        <tr>
                            <td>
                                مجال التطبيق
                            </td>
                            <td>
                                <div runat="server" id="StructureTree" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <asp:Button ID="btnSave" runat="server" CssClass="graybutton" Text="حفظ" OnClick="btnSave_Click"
                        ValidationGroup="Dis" />
                    &nbsp;<asp:Button ID="btnexit" runat="server" CssClass="graybutton" OnClick="btnexit_Click"
                        Text="إنهاء" />
                </td>
            </tr>
            <tr>
                <td align="center">
                    <asp:Literal ID="ltst" runat="server" Visible="False"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
